package com.rw.tool.util.expression.element;

import java.math.BigDecimal;

/**
 * 表达式中的数字
 */
public class NumberElement extends ExpressionElement {
    private final BigDecimal number;

    /**
     * 构建数字符号
     */
    public NumberElement(BigDecimal number) {
        this.number = number;
    }

    public NumberElement(String number) {
        this.number = new BigDecimal(number);
    }

    /**
     * 获取数字
     */
    public BigDecimal getNumber() {
        return number;
    }

    @Override
    public String toString() {
        return number.toString();
    }
}
